//
//  GroupItem.m
//  ChangChat
//
//  Created by Cocoa on 2019/10/11.
//  Copyright © 2019 yibai. All rights reserved.
//

#import "GroupItem.h"
#import <LKDBHelper/LKDBHelper.h>

@implementation GroupItem

+ (NSDictionary *)mj_objectClassInArray {
    return @{@"group_users": FriendItem.class,
             @"all_users_id": NSString.class
             };
}

+ (NSString *)getPrimaryKey {
    return @"group_id";
}

- (NSString *)getGroupCardJson {
    NSDictionary *json = @{@"group_id": self.group_id,
                           @"avatar": self.avatar,
                           @"name": self.name,
                           @"qr_type": @"group"
                           };
    
    return [json mj_JSONString];
}

- (BOOL)isEqual:(GroupItem *)object {
    if ([self.group_id isEqualToString:object.group_id] == YES) {
        return YES;
    }
    return NO;
}

@end
